//
//  LogUtil.swift
//  hear
//
//  Created by tiger on 2017/1/23.
//  Copyright © 2017年 Hunan Qinxin Information Technology co.,Ltd. All rights reserved.
//

import UIKit

internal struct LogUtil {
    
    //debug
    public static func d(format: String? = nil, _ args: Any...) {
        #if DEBUG
            print("DEBUG 🇩")
            self.log(format: format,args)
            print("\n")

        #endif
    }
    
    //info
    public static func i(format: String? = nil, _ args: Any...) {
        #if DEBUG
            print("INFO 🇮")
            self.log(format: format,args)
            print("\n")

        #endif
    }
    
    //error
    public static func e(format: String? = nil, _ args: Any...) {
        #if DEBUG
            print("ERROR 🇪")
            self.log(format: format,args)
            print("\n")
        #endif
    }
    
    //warning
    public static func w(format: String? = nil, _ args: Any...) {
        #if DEBUG
            print("WARNING 🇼")
            self.log(format: format,args)
            print("\n")
        #endif
    }
    
    //assert
    public static func a(format: String? = nil, _ args: Any...) {
        #if DEBUG
            print("ASSERT 🇦")
            self.log(format: format,args)
            print("\n")
        #endif
    }
    
    //assert
    public static func log(format: String? = nil, _ args: Any...) {
        #if DEBUG
            if format == nil {
                print(args)
            } else {
                print(format!, args)
            }
        #endif
    }
    
}
